﻿<views:MvxWpfView
	x:Class="Sidvall.AuthorizationManager.UI.Wpf.Views.DashboardView"
	xmlns:views="clr-namespace:MvvmCross.Wpf.Views;assembly=MvvmCross.Wpf"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
	xmlns:vms="clr-namespace:Sidvall.AuthorizationManager.UI.ViewModels;assembly=Sidvall.AuthorizationManager.UI"
	xmlns:Controls="clr-namespace:Sidvall.AuthorizationManager.UI.Wpf.Controls" 
	xmlns:Converters="clr-namespace:Sidvall.UI.Wpf.Converters;assembly=Sidvall.UI.Wpf" 
	mc:Ignorable="d" 
	d:DesignHeight="500" d:DesignWidth="600">

	<views:MvxWpfView.Resources>
		<Converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
		<Converters:BooleanToVisibilityConverter x:Key="NotBooleanToVisibilityConverter" Not="True"/>
	</views:MvxWpfView.Resources>

	<Grid d:DataContext="{d:DesignInstance IsDesignTimeCreatable=True, Type={x:Type vms:DashboardViewModel}}">
		<Grid.Background>
			<SolidColorBrush Color="{DynamicResource {x:Static SystemColors.InactiveBorderColorKey}}"/>
		</Grid.Background>
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto" />
			<RowDefinition Height="20" />
			<RowDefinition Height="Auto" />
			<RowDefinition Height="Auto" />
			<RowDefinition Height="Auto" />
			<RowDefinition Height="Auto" />
			<RowDefinition Height="Auto" />
			<RowDefinition Height="Auto" />
			<RowDefinition Height="Auto" />
			<RowDefinition />
			<RowDefinition Height="Auto" />
		</Grid.RowDefinitions>
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="20" />
			<ColumnDefinition Width="Auto" />
			<ColumnDefinition Width="100" />
			<ColumnDefinition Width="50" />
			<ColumnDefinition Width="Auto" />
			<ColumnDefinition Width="100" />
			<ColumnDefinition />
		</Grid.ColumnDefinitions>
		
		<Controls:HeaderControl Grid.ColumnSpan="7" HeaderCaption="Dashboard" />

		<Label Grid.Row="2" Grid.Column="1" FontSize="14" FontWeight="Bold">Authorization Scopes:</Label>
		<TextBlock Grid.Row="2" Grid.Column="2" FontSize="14" FontWeight="Bold" Text="{Binding OverView.AuthorizationScopeCount}" VerticalAlignment="Center" />

		<StackPanel Grid.Row="10" Grid.Column="1" Grid.ColumnSpan="6">
			<Grid>
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="Auto" />
					<ColumnDefinition Width="Auto" />
				</Grid.ColumnDefinitions>

				<Label  FontSize="14" FontWeight="Bold" Content="Last Updated:"/>
				<Image Grid.Column="1" Width="16" ToolTip="{Binding LastUpdatedException}" Source="/Sidvall.AuthorizationManager.UI.Wpf;component/Images/Result_Failed.png" Visibility="{Binding LastUpdatedExceptionIsVisible, Converter={StaticResource BooleanToVisibilityConverter}, Mode=OneWay}" ></Image>
			</Grid>
			<TextBlock Grid.Row="1" Text="{Binding LastUpdated}" FontSize="14" FontWeight="Bold" Padding="5,0,5,5"/>
		</StackPanel>
	</Grid>
</views:MvxWpfView>
